/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.rational.sheet.table;

import java.awt.GridLayout;
import javax.swing.JButton;
import javax.swing.JComponent;
import javax.swing.JScrollPane;
import org.rational.sheet.table.cell.model.Cell;

/**
 *
 * @author Overmind
 */
public class RationalTableComponent
    extends JComponent
{
    private static final int ROW_COUNT = 100;
    private static final int COLUMN_COUNT = 26;
    private Cell defaultCell;
    
    private RationalTableData tableData;
    private RationalTable table;
    private JScrollPane scrollPane;
    
    
    public RationalTableComponent()
    {
        initComponents();
    }
    
    private void initComponents()
    {
	tableData = new RationalTableData(ROW_COUNT, COLUMN_COUNT);
	table = new RationalTable(tableData);
	
        setLayout(new GridLayout());
        
        scrollPane = new JScrollPane(table, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED,
                JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
	
	scrollPane.setCorner(JScrollPane.UPPER_LEFT_CORNER, new JButton("*"));
	
        add(scrollPane);
    }
    
    public Cell getDefaultCell()
    {
	return defaultCell;
    }
    
    public RationalTableData getTableData()
    {
	return tableData;
    }
}
